import time


def task01():
    while True:
        print("---1---")
        time.sleep(0.2)
        yield


def task02():
    while True:
        print("---2---")
        time.sleep(0.2)
        yield


def main():
    t1 = task01()
    t2 = task02()
    while True:
        # next(t1)
        # next(t2)
        t1.__next__()
        t2.__next__()


if __name__ == "__main__":
    main()
